home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / ewl / ewl_scrollbar.h < prev    next >
C/C++ Source or Header  |  2006-01-09  |  3KB  |  91 lines

  1. #ifndef __EWL_SCROLLBAR_H__
  2. #define __EWL_SCROLLBAR_H__
  3.  
  4. /**
  5.  * @file ewl_scrollbar.h
  6.  * @defgroup Ewl_Scrollbar Scrollbar: A Simple Scrollbar Widget
  7.  * Defines an Ewl_Scrollbar for using when scrolling values are needed.
  8.  *
  9.  * @{
  10.  */
  11.  
  12. /**
  13.  * @themekey /hscrollbar/file
  14.  * @themekey /hscrollbar/group
  15.  * @themekey /vscrollbar/file
  16.  * @themekey /vscrollbar/group
  17.  *
  18.  * @themekey /hscrollbar/seeker/file
  19.  * @themekey /hscrollbar/seeker/group
  20.  * @themekey /vscrollbar/seeker/file
  21.  * @themekey /vscrollbar/seeker/group
  22.  *
  23.  * @themekey /hscrollbar/seeker/button/file
  24.  * @themekey /hscrollbar/seeker/button/group
  25.  * @themekey /vscrollbar/seeker/button/file
  26.  * @themekey /vscrollbar/seeker/button/group
  27.  */
  28.  
  29. /**
  30.  * Provides a seeker with increment and decrement buttons arranged in a
  31.  * specified order.
  32.  */
  33. typedef struct Ewl_Scrollbar Ewl_Scrollbar;
  34.  
  35. /**
  36.  * @def EWL_SCROLLBAR(scrollbar)
  37.  * Typecasts a pointer to an Ewl_Scrollbar pointer.
  38.  */
  39. #define EWL_SCROLLBAR(scrollbar) ((Ewl_Scrollbar *) scrollbar)
  40.  
  41. /**
  42.  * @struct Ewl_Scrollbar
  43.  * Inherits from Ewl_Box to layout an Ewl_Seeker and two Ewl_Buttons to
  44.  * provide scrollbar functionality.
  45.  */
  46. struct Ewl_Scrollbar
  47. {
  48.     Ewl_Box         box;               /**< Inherit from Ewl_Box */
  49.  
  50.     Ewl_Widget     *seeker;            /**< The internal Ewl_Seeker */
  51.     Ewl_Widget     *decrement;         /**< The internal decrement button */
  52.     Ewl_Widget     *increment;         /**< The internal increment button */
  53.     unsigned int    buttons_alignment; /**< The ordering of buttons */
  54.  
  55.     double          fill_percentage;   /**< Ratio of size for draggable */
  56.     double          start_time;        /**< Time scrolling began */
  57.     Ecore_Timer    *timer;             /**< Repeating timer for scrolling */
  58.     signed char     direction;         /**< */
  59.     signed char     invert;            /**< Invert the scrolling direction */
  60. };
  61.  
  62. Ewl_Widget     *ewl_scrollbar_new(void);
  63. Ewl_Widget     *ewl_hscrollbar_new(void);
  64. Ewl_Widget     *ewl_vscrollbar_new(void);
  65. int             ewl_scrollbar_init(Ewl_Scrollbar *s);
  66.  
  67. void            ewl_scrollbar_orientation_set(Ewl_Scrollbar *s,
  68.                           Ewl_Orientation orientation);
  69. Ewl_Orientation ewl_scrollbar_orientation_get(Ewl_Scrollbar *s);
  70. char            ewl_scrollbar_inverse_scroll_get(Ewl_Scrollbar *s);
  71. void            ewl_scrollbar_inverse_scroll_set(Ewl_Scrollbar *s, char v);
  72. double          ewl_scrollbar_value_get(Ewl_Scrollbar *s);
  73. void            ewl_scrollbar_value_set(Ewl_Scrollbar *s, double v);
  74.  
  75. double          ewl_scrollbar_step_get(Ewl_Scrollbar *s);
  76. void            ewl_scrollbar_step_set(Ewl_Scrollbar *s, double v);
  77.  
  78. /*
  79.  * Internally used callbacks, override at your own risk.
  80.  */
  81. void ewl_scrollbar_scroll_start_cb(Ewl_Widget *w, void *ev_data,
  82.                       void *user_data);
  83. void ewl_scrollbar_scroll_stop_cb(Ewl_Widget *w, void *ev_data,
  84.                      void *user_data);
  85.  
  86. /**
  87.  * @}
  88.  */
  89.  
  90. #endif                /* __EWL_SCROLLBAR_H__ */
  91.